 <table class="table table-hover">
        <tr>
            <th style="border:none;">ID</th>
            <th style="border:none;">发货人</th>
            <th style="border:none;">电话号码</th>
            <th style="border:none;">发货地址</th>
            <th style="border:none;">是否默认</th>
            <th style="border:none;">操作</th>
        </tr>
        <?php foreach($data as $v):?>
        <tr>
            <td><?php echo $v['id']?></td>

            <td><?php echo $v['name']?></td>
            <td><?php echo $v['mobile']?></td>
            <td><?php echo $v['address']?></td>
            <td>

                <?php

                    if ( $v['is_default'] == 1 ) {

                        echo '<span style="color:#09c;"><i class="fa fa-check"></i></span>';

                    } else {


                        echo '<span style="color: #ccc;"><i class="fa fa-check"></i></span>';

                    }


                ?>
            </td>
            <td>

                <a href="javascript:;" data-id="<?php echo $v['id']?>" class="btn btn-default btn-xs update">编辑</a>
                <?php if( $v['is_default'] != 1 ):?>
                    <a href="javascript:;" data-data={"id":<?php echo $v['id']?>} data-src="<?php echo U('Admin/Setting/SendAddress/setDefault')?>" class="btn btn-success btn-xs _ajaxNote">设为默认</a>
                    <a href="javascript:;" data-id="delete" data-msg="确定要删除吗?删除之后不可回复!" data-data={"id":<?php echo $v['id']?>} data-src="<?php echo U('Admin/Setting/SendAddress/delete')?>" class="btn btn-danger btn-xs _ajaxNote">删除</a>
                <?php endif;?>

            </td>
        </tr>
        <?php endforeach;?>
    </table>
 <script>

     $(function(){

         $('.update').unbind('click');
         $('.update').click(function(){

             var data = {};
             data.id = $(this).data('id');

             showMessage('','','<?php echo U("Admin/Setting/SendAddress/update")?>',data);

         })




     })


     //异步请求回调
     function ajaxRequestCallback(result,id,_this)
     {

         if ( id == 'delete' ) {

             if ( result.code == 200 ) {
                 _this
                         .parent()
                         .parent()
                         .fadeOut(200,function(){

                             $(this).remove();

                         });

             }


             showMessage(result.msg,result.code,'','',2000);

         } else {

             showMessage(result.msg,result.code,'<?php echo U("Admin/Setting/SendAddress/lists")?>',{},2000);

         }


     }

 </script>


